/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jpa;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "prezzo")
@NamedQueries({
    @NamedQuery(name = "Prezzo.findAll", query = "SELECT p FROM Prezzo p"),
    @NamedQuery(name = "Prezzo.findById", query = "SELECT p FROM Prezzo p WHERE p.id = :id"),
    @NamedQuery(name = "Prezzo.findByPrezzo", query = "SELECT p FROM Prezzo p WHERE p.prezzo = :prezzo"),
    @NamedQuery(name = "Prezzo.findByDataRiferimento", query = "SELECT p FROM Prezzo p WHERE p.dataRiferimento = :dataRiferimento"),
    @NamedQuery(name = "Prezzo.findByTipoid", query = "SELECT p FROM Prezzo p WHERE p.tipoid = :tipoid")})
public class Prezzo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "prezzo")
    private Double prezzo;
    @Column(name = "dataRiferimento")
    @Temporal(TemporalType.DATE)
    private Date dataRiferimento;
    @Column(name = "tipoid")
    private Integer tipoid;

    public Prezzo() {
    }

    public Prezzo(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Double getPrezzo() {
        return prezzo;
    }

    public void setPrezzo(Double prezzo) {
        this.prezzo = prezzo;
    }

    public Date getDataRiferimento() {
        return dataRiferimento;
    }

    public void setDataRiferimento(Date dataRiferimento) {
        this.dataRiferimento = dataRiferimento;
    }

    public Integer getTipoid() {
        return tipoid;
    }

    public void setTipoid(Integer tipoid) {
        this.tipoid = tipoid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Prezzo)) {
            return false;
        }
        Prezzo other = (Prezzo) object;
        return (this.id != null || other.id == null) && (this.id == null || this.id.equals(other.id));
    }

    @Override
    public String toString() {
        return "jpa.Prezzo[id=" + id + "]";
    }

}
